#include <stdio.h>
#include "login.h"
#include "book.h"

int Register(P_User_t HEAD, Manager *manager, int *a)
{
    int n = 0;
    printf("1)用户注册 2)管理员注册\n");
    printf("请输入您的操作：");
    scanf("%d", &n);
    switch (n)
    {
    case 1:
        *a =  UserRegister(HEAD);
        break;
    case 2:
        *a = ManagerRegister(manager);
        break;
    default:
        break;
    }
    
}

int Login(P_User_t HEAD, Manager *manager, int *b,int a)
{
    int n = 0;
    printf("1)用户登录 2)管理员登录\n");
    printf("请输入您的操作：");
    scanf("%d", &n);
    switch (n)
    {
    case 1:
        *b = UserLogin(HEAD,a);
        break;
    case 2:
        *b = ManagerLogin(manager,a);
        break;
    default:
        break;
    }
}